<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="./00100/common/init.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
<meta name="renderer" content="webkit"/>
<title>国付宝</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<link rel="stylesheet" href="${ctx}/static/css/innsbruck.css" />
	<style>
		body,html,img,p{ margin:0; padding:0;}
		.loading{ width:300px; height:100px; position:absolute; left:0; top:0; right:0; bottom:0; margin:auto; overflow:hidden;}
		.loading .innerWrap{ display:table; text-align:center; vertical-align:middle; width:100%; height:100%;}
		.loading .inner{ display:table-cell;width:100%; height:100%; color:#666; font-size:14px; line-height:20px; vertical-align:middle}
	</style>
	<script type="text/javascript" src="${ctx}/static/js/jquery-1.8.3.min.js"></script>
<c:choose>
	<c:when test="${token != null}">
		<script type="text/javascript" charset="utf-8">
			$(function() {
				flushLoginTicket();
			});
			var authUrl = '${authUrl}';
			var portal = '${cashierUrl}';
			var flushLoginTicket = function() {
				//if($("#loginEmail").val()==""){
					//var orderId = $("#orderId").val();
					var _services = 'service='+ encodeURIComponent(portal);
					var url = authUrl+'/login?' + _services + '&get-lt=true&n=' + new Date().getTime();
				    var jsonpScript = document.createElement('script');
				    jsonpScript.setAttribute('src', url);
				    document.getElementsByTagName('head')[0].appendChild(jsonpScript);
				//}
			};
			function callback(data){
				$("#lt").val(data.loginTicket);
				//formSubmit('loginSSOForm');
				setTimeout(function(){$("#loginSSOForm").submit();},1000);
			}
			function formSubmit(id) {
				$("#"+id).submit();
			}
		</script>
	</c:when>
	<c:otherwise>
		<script type="text/javascript" charset="utf-8">
		 /* $(function() {
		     setTimeout(function(){
		   		window.location.href='${cloudUrl}';},1000);
		    }); */
		</script>
	</c:otherwise>
</c:choose>
<script type="text/javascript" charset="utf-8">
		var jQT = new $.jQT({
			preloadImages : []
		});
		//window.history.forward(1); 
	</script>
</head>
<body>
<div class="loading">
	<div class="innerWrap">
    	<div class="inner">
           <%--  <p><img height="30px" src="${ctx }/images/loading_4.gif"/></p> --%>
            <p style="margin-top:10px;">加载中，请稍候...</p>
        </div>
    </div>
</div>

		<form action="${authUrl }/login" method="post" id="loginSSOForm" name="loginSSOForm" class="noAjax">
		<input  value="${userId }" type="hidden" name="username" id="user" />
		<input  value="${token }" type="hidden" name="password" />
		<input type="hidden" name="lt" id="lt"/>
		<input type="hidden" name="userType" id="userType" value="80"/>
		<input type="hidden" name="sessionId" id="sessionId" value="CLOUD"/>
		<input type="hidden" name="clientIp" id="clientIp" value="${clientIp }"/>
        <input type="hidden" name="pwdToken" id="pwdToken" />  
        <input type="hidden" name="_eventId" value="submit" /> 
        <input type="hidden" name="custSubmit" id="custSubmit" value="true"/> 
		<!-- <a href="javascript:viod(0);"    class="redButton" onclick="formSubmit('loginSSOForm');">登陆</a> -->
		</form>



</body>
</html>

